using System;
using SpecificationPatternCode.Contracts;

namespace SpecificationPatternCode.BaseSpecs
{
	public class GreaterThanSpecification<T> : ISpecification<T> where T : IComparable<T>
	{
		private readonly T _lower;

		public GreaterThanSpecification(T lower)
		{
			_lower = lower;
		}

		public bool IsSatisfiedBy(T candidate)
		{
			return candidate.CompareTo(_lower) > -1;
		}
	}
}